<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchFormDict").submit();
        return false;
    }
    function findById(id,scheduledId){
        <%--console.log(id+"+++"+scheduledId);--%>
        <%--loadDiv('rigthCenterDiv','${ctx}/operation/operationMaster/findById');--%>
        <%--findByOperation(id,scheduledId);--%>
    }
</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-2">
            <div class="content-wrap" id="leftCenterDiv">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#">手术登记列表</a>
                        </li>
                    </ul>

                    <%--左侧药品字典列表--%>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <%--处方查询--%>
                                        <form:form id="searchFormDict" modelAttribute="operationMaster"
                                                   onsubmit="return loadDivForm('mainCenterDiv','searchFormDict','${ctx}/operation/operationMaster/findByOperationTime');"
                                                   method="post" class="form-inline">
                                            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                            <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/><br/>
                                            <label>是否登记:</label><form:checkbox path="batch" id="batch" htmlEscape="false"></form:checkbox>
                                            <label>手术时间:<input id="scheduledDate" name="scheduledDate" htmlEscape="false" class="form-control Wdate"
                                                               data-parsley-required="true"
                                                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
                                                               value='<fmt:formatDate value="${operationMaster.scheduledDate}" pattern="yyyy-MM-dd"/>'/>
                                            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="btsubmit()"/>
                                        </form:form>
                                    </div>
                                </div>

                                <%--药品名称列表--%>
                                <div class="container-fluid">
                                    <table id="contentTable1" class="table table-bordered mg-t datatable">
                                        <thead>
                                        <tr>
                                            <th hidden>id</th>
                                            <th hidden>masterId</th>
                                            <th>姓名</th>
                                            <th>手术时间</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <c:forEach items="${page.list}" var="operationMaster">
                                        <tr onclick="loadDiv('rigthCenterDiv','${ctx}/operation/operationMaster/findById?id=${operationMaster.id}&scheduledId=${operationMaster.scheduledId}')">
                                            <td hidden> ${operationMaster.id}</td>
                                            <td hidden> ${operationMaster.scheduledId}</td>
                                            <td> ${operationMaster.patientId}</td>
                                            <td><fmt:formatDate value="${operationMaster.scheduledDate}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                                        </tr>
                                        </c:forEach>
                                    </table>
                                    <div class="pagination">${page}</div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>

        <%--右侧药品规格字典列表--%>
        <section class="main-content col-lg-8">
            <div class="content-wrap" id="rigthCenterDiv">

            </div>
        </section>
    </section>
</div>

